package cn.wuqingna.legendgem.script

import org.bukkit.entity.Player


object CaCheScript: Script {
    override val key: String
        get() = "cache"

    override fun eval(player: Player, args: String, cache: MutableMap<String, String>): String {
        val key = args.replace(" ", "").split("{cache:")[1].replace("}", "")
        return if (cache.containsKey(key)){
            cache[key]!!
        } else {
            println("cache 语句错误不存在该缓存数据 $args")
            "不存在该缓存数据"
        }
    }
}